package com.lucker.ds.model;

import java.util.Date;

/**
 * sys_check_code
 * @author 
 */
public class SysCheckCode extends BaseValueObject {
    private Long id;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 验证码
     */
    private String code;

    /**
     * type(1:注册类型 2：找回密码)
     */
    private Integer type;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 状态 0:禁用 1:启用
     */
    private Integer status;

    /**
     * 校验码所属用户id
     */
    private Long userId;

    private Date updateTime;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }



    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

 

    public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByMobile(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by mobile asc";
            }else{
                this.orderStr = this.orderStr + ",mobile asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by mobile desc";
            }else{
                this.orderStr = this.orderStr + ",mobile desc";
            }
        }
    }

    public void orderByCode(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by code asc";
            }else{
                this.orderStr = this.orderStr + ",code asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by code desc";
            }else{
                this.orderStr = this.orderStr + ",code desc";
            }
        }
    }

    public void orderByType(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by type asc";
            }else{
                this.orderStr = this.orderStr + ",type asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by type desc";
            }else{
                this.orderStr = this.orderStr + ",type desc";
            }
        }
    }

    public void orderByCreateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by create_time asc";
            }else{
                this.orderStr = this.orderStr + ",create_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by create_time desc";
            }else{
                this.orderStr = this.orderStr + ",create_time desc";
            }
        }
    }

    public void orderByStatus(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by status asc";
            }else{
                this.orderStr = this.orderStr + ",status asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by status desc";
            }else{
                this.orderStr = this.orderStr + ",status desc";
            }
        }
    }

    public void orderByUserId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_id asc";
            }else{
                this.orderStr = this.orderStr + ",user_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_id desc";
            }else{
                this.orderStr = this.orderStr + ",user_id desc";
            }
        }
    }

    public void orderByUpdateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by update_time asc";
            }else{
                this.orderStr = this.orderStr + ",update_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by update_time desc";
            }else{
                this.orderStr = this.orderStr + ",update_time desc";
            }
        }
    }
}